<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>

<title>Bloodhound (randoop 4.1.0 API)</title>

<link rel="stylesheet" type="text/css" href="../../javadocstyle.css" title="Style">
<script type="text/javascript" src="../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
    try {
        if (location.href.indexOf('is-external=true') == -1) {
            parent.document.title="Bloodhound (randoop 4.1.0 API)";
        }
    }
    catch(err) {
    }
//-->
var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../randoop/generation/AbstractGenerator.html" title="class in randoop.generation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../randoop/generation/ComponentManager.html" title="class in randoop.generation"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?randoop/generation/Bloodhound.html" target="_top">Frames</a></li>
<li><a href="Bloodhound.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">randoop.generation</div>
<h2 title="Class Bloodhound" class="title">Class Bloodhound</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>randoop.generation.Bloodhound</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><a href="../../randoop/generation/TypedOperationSelector.html" title="interface in randoop.generation">TypedOperationSelector</a></dd>
</dl>
<hr>
<br>
<pre>public class <span class="typeNameLabel">Bloodhound</span>
extends <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>
implements <a href="../../randoop/generation/TypedOperationSelector.html" title="interface in randoop.generation">TypedOperationSelector</a></pre>
<div class="block">Implements the Bloodhound component, as described by the paper "GRT: Program-Analysis-Guided
 Random Testing" by Ma et. al (appears in ASE 2015):
 https://people.kth.se/~artho/papers/lei-ase2015.pdf .

 <p>Bloodhound computes a weight for each method under test by taking a weighted combination of

 <ul>
   <li>the uncovered branch ratio and
   <li>the ratio between the number of times the method has been successfully invoked (to be the
       last statement of a new regression test) and the maximum number of times any method under
       test has been successfully invoked.
 </ul>

 A method is "successfully invoked" when a method under test is used to create a new sequence and
 the sequence is kept as a regression test. An alternative definition of "successful invocations"
 is the total number of times the method appears in any regression test. Both definitions are
 consistent with the description in the GRT paper. We believe our implementation, which uses the
 first definition, is likely what was intended by the authors of the GRT paper.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#alpha">alpha</a></span></code>
<div class="block">Parameter for balancing branch coverage and number of times a method was chosen.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#branchCoverageInterval">branchCoverageInterval</a></span></code>
<div class="block">Branch coverage is recomputed after this many successful invocations (= this many new tests
 were generated).</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../../randoop/generation/CoverageTracker.html" title="class in randoop.generation">CoverageTracker</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#coverageTracker">coverageTracker</a></span></code>
<div class="block">Coverage tracker used to get branch coverage information of methods under test.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#lastUpdateTime">lastUpdateTime</a></span></code>
<div class="block"><code>System.currentTimeMillis()</code> when branch coverage was last updated.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#maxSuccM">maxSuccM</a></span></code>
<div class="block">Maximum number of times any method under test has been successfully invoked.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#methodInvocationCounts">methodInvocationCounts</a></span></code>
<div class="block">Map from methods under test to the total number of times they have ever been successfully
 invoked by the <a href="../../randoop/generation/AbstractGenerator.html" title="class in randoop.generation"><code>AbstractGenerator</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#methodSelectionCounts">methodSelectionCounts</a></span></code>
<div class="block">Map from methods under test to the number of times they have been recently selected by the
 <a href="../../randoop/generation/ForwardGenerator.html" title="class in randoop.generation"><code>ForwardGenerator</code></a> to construct a new sequence.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#methodWeights">methodWeights</a></span></code>
<div class="block">Map from methods under test to their weights.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private <a href="../../randoop/util/SimpleArrayList.html" title="class in randoop.util">SimpleArrayList</a>&lt;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>&gt;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#operationSimpleList">operationSimpleList</a></span></code>
<div class="block">List of operations, identical to <a href="../../randoop/generation/ForwardGenerator.html" title="class in randoop.generation"><code>ForwardGenerator</code></a>'s operation list.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private static double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#p">p</a></span></code>
<div class="block">Parameter for decreasing weights of methods between updates to coverage information.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private static long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#t">t</a></span></code>
<div class="block">Time interval, in milliseconds, at which to recompute weights.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>private int</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#totalSuccessfulInvocations">totalSuccessfulInvocations</a></span></code>
<div class="block">The total number of successful invocations of all the methods under test.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>private double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#totalWeightOfMethodsUnderTest">totalWeightOfMethodsUnderTest</a></span></code>
<div class="block">The total weight of all the methods that are under test.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#Bloodhound-java.util.List-java.util.Set-">Bloodhound</a></span>(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>&gt;&nbsp;operations,
          <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="../../randoop/types/ClassOrInterfaceType.html" title="class in randoop.types">ClassOrInterfaceType</a>&gt;&nbsp;classesUnderTest)</code>
<div class="block">Initialize Bloodhound.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#incrementSuccessfulInvocationCount-randoop.operation.TypedOperation-">incrementSuccessfulInvocationCount</a></span>(<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>&nbsp;operation)</code>
<div class="block">Increments the number of times a method under test was successfully invoked.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>private void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#logMethodWeights--">logMethodWeights</a></span>()</code>
<div class="block">For debugging, print all method weights to standard output.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#newRegressionTestHook-randoop.sequence.Sequence-">newRegressionTestHook</a></span>(<a href="../../randoop/sequence/Sequence.html" title="class in randoop.sequence">Sequence</a>&nbsp;sequence)</code>
<div class="block">Increment the number of successful invocations of the last method in the newly-created sequence
 that was classified as a regression test.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#selectOperation--">selectOperation</a></span>()</code>
<div class="block">Selects a method under test for the <a href="../../randoop/generation/ForwardGenerator.html" title="class in randoop.generation"><code>ForwardGenerator</code></a> to use to construct a new
 sequence.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>private void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#updateBranchCoverageMaybe--">updateBranchCoverageMaybe</a></span>()</code>
<div class="block">When an interval is reached, the branch coverage information for all methods under test is
 updated and the weight for every method under test is recomputed.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>private double</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#updateWeight-randoop.operation.TypedOperation-">updateWeight</a></span>(<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>&nbsp;operation)</code>
<div class="block">Recompute weight for a method under test.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>private void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../randoop/generation/Bloodhound.html#updateWeightsForAllOperations--">updateWeightsForAllOperations</a></span>()</code>
<div class="block">Computes and updates weights in <code>methodWeights</code> map for all methods under test.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#equals-java.lang.Object-" title="class or interface in java.lang">equals</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!--   -->
</a>
<h3>Field Detail</h3>
<a name="coverageTracker">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>coverageTracker</h4>
<pre>private final&nbsp;<a href="../../randoop/generation/CoverageTracker.html" title="class in randoop.generation">CoverageTracker</a> coverageTracker</pre>
<div class="block">Coverage tracker used to get branch coverage information of methods under test.</div>
</li>
</ul>
<a name="methodWeights">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>methodWeights</h4>
<pre>private final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Double.html?is-external=true" title="class or interface in java.lang">Double</a>&gt; methodWeights</pre>
<div class="block">Map from methods under test to their weights. These weights are dynamic and depend on branch
 coverage.</div>
</li>
</ul>
<a name="methodSelectionCounts">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>methodSelectionCounts</h4>
<pre>private final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt; methodSelectionCounts</pre>
<div class="block">Map from methods under test to the number of times they have been recently selected by the
 <a href="../../randoop/generation/ForwardGenerator.html" title="class in randoop.generation"><code>ForwardGenerator</code></a> to construct a new sequence. This map is cleared every time branch
 coverage is recomputed.</div>
</li>
</ul>
<a name="methodInvocationCounts">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>methodInvocationCounts</h4>
<pre>private final&nbsp;<a href="https://docs.oracle.com/javase/8/docs/api/java/util/Map.html?is-external=true" title="class or interface in java.util">Map</a>&lt;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>,<a href="https://docs.oracle.com/javase/8/docs/api/java/lang/Integer.html?is-external=true" title="class or interface in java.lang">Integer</a>&gt; methodInvocationCounts</pre>
<div class="block">Map from methods under test to the total number of times they have ever been successfully
 invoked by the <a href="../../randoop/generation/AbstractGenerator.html" title="class in randoop.generation"><code>AbstractGenerator</code></a>. The integer value for a given method is
 non-decreasing during a run of Randoop.</div>
</li>
</ul>
<a name="operationSimpleList">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>operationSimpleList</h4>
<pre>private final&nbsp;<a href="../../randoop/util/SimpleArrayList.html" title="class in randoop.util">SimpleArrayList</a>&lt;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>&gt; operationSimpleList</pre>
<div class="block">List of operations, identical to <a href="../../randoop/generation/ForwardGenerator.html" title="class in randoop.generation"><code>ForwardGenerator</code></a>'s operation list. Used for making
 random, weighted selections for a method under test.</div>
</li>
</ul>
<a name="alpha">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>alpha</h4>
<pre>private static final&nbsp;double alpha</pre>
<div class="block">Parameter for balancing branch coverage and number of times a method was chosen. The name
 "alpha" and the specified value are both from the GRT paper.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../constant-values.html#randoop.generation.Bloodhound.alpha">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="p">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>p</h4>
<pre>private static final&nbsp;double p</pre>
<div class="block">Parameter for decreasing weights of methods between updates to coverage information. The name
 "p" and the specified value are both from the GRT paper.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../constant-values.html#randoop.generation.Bloodhound.p">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="t">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>t</h4>
<pre>private static final&nbsp;long t</pre>
<div class="block">Time interval, in milliseconds, at which to recompute weights. The name "t" and the specified
 value are both from the GRT paper.</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../constant-values.html#randoop.generation.Bloodhound.t">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="lastUpdateTime">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>lastUpdateTime</h4>
<pre>private&nbsp;long lastUpdateTime</pre>
<div class="block"><code>System.currentTimeMillis()</code> when branch coverage was last updated.</div>
</li>
</ul>
<a name="branchCoverageInterval">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>branchCoverageInterval</h4>
<pre>private static final&nbsp;int branchCoverageInterval</pre>
<div class="block">Branch coverage is recomputed after this many successful invocations (= this many new tests
 were generated).</div>
<dl>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../constant-values.html#randoop.generation.Bloodhound.branchCoverageInterval">Constant Field Values</a></dd>
</dl>
</li>
</ul>
<a name="totalSuccessfulInvocations">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>totalSuccessfulInvocations</h4>
<pre>private&nbsp;int totalSuccessfulInvocations</pre>
<div class="block">The total number of successful invocations of all the methods under test.</div>
</li>
</ul>
<a name="maxSuccM">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>maxSuccM</h4>
<pre>private&nbsp;int maxSuccM</pre>
<div class="block">Maximum number of times any method under test has been successfully invoked. This value is
 initialized to 1 because it is used as the denominator of a division in computing a method's
 weight. The name is from the GRT paper, which calls this quantity "maxSucc(M)".</div>
</li>
</ul>
<a name="totalWeightOfMethodsUnderTest">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>totalWeightOfMethodsUnderTest</h4>
<pre>private&nbsp;double totalWeightOfMethodsUnderTest</pre>
<div class="block">The total weight of all the methods that are under test. This is used by <a href="../../randoop/util/Randomness.html" title="class in randoop.util"><code>Randomness</code></a> to
 randomly select an element from a list of weighted elements.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="Bloodhound-java.util.List-java.util.Set-">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Bloodhound</h4>
<pre>public&nbsp;Bloodhound(<a href="https://docs.oracle.com/javase/8/docs/api/java/util/List.html?is-external=true" title="class or interface in java.util">List</a>&lt;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>&gt;&nbsp;operations,
                  <a href="https://docs.oracle.com/javase/8/docs/api/java/util/Set.html?is-external=true" title="class or interface in java.util">Set</a>&lt;<a href="../../randoop/types/ClassOrInterfaceType.html" title="class in randoop.types">ClassOrInterfaceType</a>&gt;&nbsp;classesUnderTest)</pre>
<div class="block">Initialize Bloodhound. Branch coverage information is initialized and all methods under test
 are assigned a weight based on the weighting scheme defined by GRT's description of Bloodhound.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>operations</code> - list of operations under test</dd>
<dd><code>classesUnderTest</code> - set of classes under test</dd>
</dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="selectOperation--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>selectOperation</h4>
<pre>public&nbsp;<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>&nbsp;selectOperation()</pre>
<div class="block">Selects a method under test for the <a href="../../randoop/generation/ForwardGenerator.html" title="class in randoop.generation"><code>ForwardGenerator</code></a> to use to construct a new
 sequence. A method under test is randomly selected with a weighted probability.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../randoop/generation/TypedOperationSelector.html#selectOperation--">selectOperation</a></code>&nbsp;in interface&nbsp;<code><a href="../../randoop/generation/TypedOperationSelector.html" title="interface in randoop.generation">TypedOperationSelector</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the chosen <code>TypedOperation</code> for the new sequence</dd>
</dl>
</li>
</ul>
<a name="updateBranchCoverageMaybe--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>updateBranchCoverageMaybe</h4>
<pre>private&nbsp;void&nbsp;updateBranchCoverageMaybe()</pre>
<div class="block">When an interval is reached, the branch coverage information for all methods under test is
 updated and the weight for every method under test is recomputed.

 <p>There are two choices for when to update branch coverage information:

 <ul>
   <li>Time: branch coverage is updated when more than <code>t</code> milliseconds have elapsed since
       branch coverage was last updated. This is GRT's approach and is the default. It makes
       Randoop non-deterministic.
   <li>Count of successful invocations: branch coverage is updated after every <code>branchCoverageInteral</code> successful invocations (of any method under test).
 </ul></div>
</li>
</ul>
<a name="logMethodWeights--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>logMethodWeights</h4>
<pre>private&nbsp;void&nbsp;logMethodWeights()</pre>
<div class="block">For debugging, print all method weights to standard output.</div>
</li>
</ul>
<a name="updateWeightsForAllOperations--">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>updateWeightsForAllOperations</h4>
<pre>private&nbsp;void&nbsp;updateWeightsForAllOperations()</pre>
<div class="block">Computes and updates weights in <code>methodWeights</code> map for all methods under test.
 Recomputes the <code>totalWeightOfMethodsUnderTest</code> to avoid problems with round-off error.</div>
</li>
</ul>
<a name="updateWeight-randoop.operation.TypedOperation-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>updateWeight</h4>
<pre>private&nbsp;double&nbsp;updateWeight(<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>&nbsp;operation)</pre>
<div class="block">Recompute weight for a method under test. A method under test is assigned a weight based on a
 weighted combination of

 <ul>
   <li>the number of branches uncovered and
   <li>the ratio between the number of times this method has been recently selected and the
       maximum number of times any method under test has been successfully invoked.
 </ul>

 The weighting scheme is based on Bloodhound in the Guided Random Testing (GRT) paper.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>operation</code> - method to compute weight for</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the updated weight for the given operation</dd>
</dl>
</li>
</ul>
<a name="incrementSuccessfulInvocationCount-randoop.operation.TypedOperation-">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>incrementSuccessfulInvocationCount</h4>
<pre>public&nbsp;void&nbsp;incrementSuccessfulInvocationCount(<a href="../../randoop/operation/TypedOperation.html" title="class in randoop.operation">TypedOperation</a>&nbsp;operation)</pre>
<div class="block">Increments the number of times a method under test was successfully invoked.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>operation</code> - the method under test that was successfully invoked</dd>
</dl>
</li>
</ul>
<a name="newRegressionTestHook-randoop.sequence.Sequence-">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>newRegressionTestHook</h4>
<pre>public&nbsp;void&nbsp;newRegressionTestHook(<a href="../../randoop/sequence/Sequence.html" title="class in randoop.sequence">Sequence</a>&nbsp;sequence)</pre>
<div class="block">Increment the number of successful invocations of the last method in the newly-created sequence
 that was classified as a regression test.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../randoop/generation/TypedOperationSelector.html#newRegressionTestHook-randoop.sequence.Sequence-">newRegressionTestHook</a></code>&nbsp;in interface&nbsp;<code><a href="../../randoop/generation/TypedOperationSelector.html" title="interface in randoop.generation">TypedOperationSelector</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>sequence</code> - newly-created sequence that was classified as a regression test</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!--   -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../index-all.html">Index</a></li>
<li><a href="../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../randoop/generation/AbstractGenerator.html" title="class in randoop.generation"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../randoop/generation/ComponentManager.html" title="class in randoop.generation"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../index.html?randoop/generation/Bloodhound.html" target="_top">Frames</a></li>
<li><a href="Bloodhound.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>
